local polynimal = {}

function modify_coef (polynimal, exp, coef)
	polynimal[exp + 1] = coef
end

function calcute (polynimal, x)
	local res = 0
	for exp, coef in pairs(polynimal) do
		res = res + coef * x^(exp - 1)
	end
	return res
end

polynimal = {1, 1, 1}
modify_coef(polynimal, 1, 3)
print(calcute(polynimal, 2))
